package com.honey.mybatis.generator.page.method;

import com.honey.compilation.java.Method;
import com.honey.compilation.java.MethodDecoration;
import com.honey.core.types.FullyQualifiedJavaType;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.AbstractMethod;

public class GetPageStartMethod extends AbstractMethod {
	
	private static final String METHOD_NAME = "getPageStart" ;
	
	private static final String[] JAVA_DOC = new String[]{
		"获取页码(从0开始计数)."
	}; 

	private static final FullyQualifiedJavaType RETURN_TYPE = JDKFullyQualifiedJavaType.getIntInstance() ;
	
	@Override
	protected void addBody(Method method) {
		method.addBodyLine("return this.start");
	}

	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}
	
	@Override
	protected FullyQualifiedJavaType getReturnType() {
		return RETURN_TYPE;
	}

	@Override
	protected MethodDecoration getMethodDecoration() {
		MethodDecoration answer =  super.getMethodDecoration() ;
		answer.setFinal(true);
		return answer;
	}

	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}
	
	
}
